package com.enhe.gck.exception;

import com.enhe.gck.communal.ResultCode;
import lombok.Getter;
import lombok.Setter;

/**
 * @Author 褚波
 * @Date 2024-04-19 11:10:27
 * @Description 自定义异常
 */
@Getter
@Setter
public class MySqlException extends RuntimeException {

    /**
     * 错误码
     */
    protected Integer errorCode;
    /**
     * 错误信息
     */
    protected String errorMsg;

    public MySqlException() {
        super();
    }

    public MySqlException(String errorMsg) {
        this(ResultCode.ZERO.getCode(), errorMsg);
    }

    public MySqlException(Integer errorCode, String errorMsg) {
        super(errorMsg);
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;
    }

}
